﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="wfOrdenCompras.aspx.cs" Inherits="wfCompras.wfOrdenCompras" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:Button ID="btnNuevo" runat="server" onclick="btnNuevo_Click" 
        Text="Nuevo" />
      <asp:Button ID="Button1" runat="server" onclick="Button1_Click" 
        Text="Button" />
      <br />
     <input id="hidId" runat="server" name="hidId" size="1" style="width: 32px; height: 22px"
                    type="hidden" />
     <input id="hdProducto" runat="server" name="hdColor" size="1" style="width: 32px; height: 22px"
                    type="hidden" />
    <asp:GridView ID="GVDetalleProducto" runat="server"  ScrollBars="Auto" 
                            ScrollWidth="100%" Width="100%" AutoGenerateColumns="False" 
                            ShowHeaderWhenEmpty="True">
        
        <AlternatingRowStyle CssClass="esdGridAlternativeRowStyle" />
        <Columns>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:ImageButton ID="grdBttCmdEdit" CommandName="CmdEdit" CommandArgument="<%# Container.DataItemIndex %>"
                                    runat="server" ImageUrl="../Images/Icons/Enabled/Edit.png" 
                                    ToolTip="Modificar el Registro" 
                        onclick="grdBttCmdEdit_Click" />
                </ItemTemplate>
                <HeaderStyle Width="22px" />
                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="idProducto">
                <ItemTemplate>
                    <asp:TextBox ID="txtIdproducto" runat="server"  CssClass="esdTextBox"  
                                    Width="100px"  Text='<%# DataBinder.Eval(Container, "DataItem._Codigo") %>' 
                                    Enabled="False"></asp:TextBox>
                </ItemTemplate>
                <FooterStyle Font-Size="X-Small" />
                <HeaderStyle Font-Size="X-Small" />
                <ItemStyle Font-Size="X-Small" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Id pres">
                <ItemTemplate>
                    <asp:TextBox ID="txtIdPres" runat="server" CssClass="esdTextBox"  Width="50px"  
                                    Text='<%# DataBinder.Eval(Container, "DataItem._Pres") %>' 
                        Enabled="False"></asp:TextBox>
                </ItemTemplate>
                <HeaderStyle Font-Size="X-Small" />
                <FooterStyle Font-Size="X-Small" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Producto">
                <ItemTemplate>
                    <asp:TextBox ID="txtDsProducto" runat="server" CssClass="esdTextBox"  
                                    Width="200px"  Text='<%# DataBinder.Eval(Container, "DataItem._Producto") %>' 
                                    Enabled="False"></asp:TextBox>
                </ItemTemplate>
                <HeaderStyle Font-Size="X-Small" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Presentacion">
                <ItemTemplate>
                    <asp:TextBox ID="txtPresentacion" runat="server" CssClass="esdTextBox"  
                                    Width="50px"  Text='<%# DataBinder.Eval(Container, "DataItem._Presenta") %>' 
                                    Enabled="False"></asp:TextBox>
                </ItemTemplate>
                <FooterStyle Font-Size="X-Small" />
                <HeaderStyle Font-Size="X-Small" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="U.M">
                <ItemTemplate>
                    <asp:TextBox ID="txtUM" runat="server" CssClass="esdTextBox"  Width="50px"  
                                    Text='<%# DataBinder.Eval(Container, "DataItem._UM") %>' 
                        Enabled="False"></asp:TextBox>
                </ItemTemplate>
                <FooterStyle Font-Size="X-Small" />
                <HeaderStyle Font-Size="X-Small" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Peso Bruto">
                <ItemTemplate>
                    <asp:TextBox ID="txtPesoBruto" runat="server" CssClass="esdTextBox"  
                                    Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._Peso_Bruto") %>' 
                                    Enabled="False"></asp:TextBox>
                </ItemTemplate>
                <FooterStyle Font-Size="X-Small" />
                <HeaderStyle Font-Size="X-Small" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Lote">
                <ItemTemplate>
                    <asp:TextBox ID="txtLote" runat="server" CssClass="esdTextBox" Width="50px" 
                                    Text='<%# DataBinder.Eval(Container, "DataItem._Lote") %>'></asp:TextBox>
                </ItemTemplate>
                <HeaderStyle Font-Size="X-Small" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Fec. Vencimiento">
                <ItemTemplate>
                    <asp:TextBox ID="txtFecVencimiento" runat="server" CssClass="esdTextBox" 
                                    Width="75px" 
                        Text='<%# DataBinder.Eval(Container, "DataItem._fe_venc") %>'></asp:TextBox>
                </ItemTemplate>
                <HeaderStyle Font-Size="X-Small" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Fec.Entrega">
                <ItemTemplate>
                    <asp:TextBox ID="txtFecEngrega" runat="server" CssClass="esdTextBox" 
                                    Width="75px" 
                                    
                        Text='<%# DataBinder.Eval(Container, "DataItem._fe_Entrega") %>'></asp:TextBox>
                </ItemTemplate>
                <HeaderStyle Font-Size="X-Small" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="O.P">
                <ItemTemplate>
                    <asp:TextBox ID="txtOp" runat="server" CssClass="esdTextBox" 
                                    Text='<%# DataBinder.Eval(Container, "DataItem._OP") %>'></asp:TextBox>
                </ItemTemplate>
                <HeaderStyle Font-Size="X-Small" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Cantidad">
                <ItemTemplate>
                    <asp:TextBox ID="txtCantidad" runat="server" CssClass="esdTextBox" Width="50px" 
                                    Text='<%# DataBinder.Eval(Container, "DataItem._Cant") %>'></asp:TextBox>
                </ItemTemplate>
                <HeaderStyle Font-Size="X-Small" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="p.Neto">
                <ItemTemplate>
                    <asp:TextBox ID="txtPneto" runat="server" CssClass="esdTextBox" Width="50px" 
                                    Text='<%# DataBinder.Eval(Container, "DataItem._PreNeto") %>'></asp:TextBox>
                </ItemTemplate>
                <FooterStyle Font-Size="X-Small" />
                <HeaderStyle Font-Size="X-Small" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="P.U">
                <ItemTemplate>
                    <asp:TextBox ID="txtPU" runat="server" CssClass="esdTextBox" Width="50px" 
                                    Text='<%# DataBinder.Eval(Container, "DataItem._PreUnit") %>'></asp:TextBox>
                </ItemTemplate>
                <ControlStyle Font-Size="X-Small" />
                <HeaderStyle Font-Size="X-Small" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="C.Gasto">
                <ItemTemplate>
                    <asp:TextBox ID="txtCGasto" runat="server" CssClass="esdTextBox" Width="75px" 
                                    Text='<%# DataBinder.Eval(Container, "DataItem._C_Gasto") %>'></asp:TextBox>
                </ItemTemplate>
                <HeaderStyle Font-Size="X-Small" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="T.G">
                <ItemTemplate>
                    <asp:TextBox ID="txtTipoGasto" runat="server" CssClass="esdTextBox" 
                                    Width="75px" 
                                    Text='<%# DataBinder.Eval(Container, "DataItem._Tipgasto") %>'></asp:TextBox>
                </ItemTemplate>
                <ControlStyle Font-Size="X-Small" />
                <FooterStyle Font-Size="X-Small" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Dscto">
                <ItemTemplate>
                    <asp:TextBox ID="txtDscto" runat="server" CssClass="esdTextBox" Width="50px" 
                                    Text='<%# DataBinder.Eval(Container, "DataItem._Dscto") %>'></asp:TextBox>
                </ItemTemplate>
                <FooterStyle Font-Size="X-Small" />
                <HeaderStyle Font-Size="X-Small" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="IGV">
                <ItemTemplate>
                    <asp:TextBox ID="txtIGV" runat="server" CssClass="esdTextBox" Width="50px" 
                                    Text='<%# DataBinder.Eval(Container, "DataItem._Igv") %>'></asp:TextBox>
                </ItemTemplate>
                <HeaderStyle Font-Size="X-Small" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Sub. Total">
                <ItemTemplate>
                    <asp:TextBox ID="txtSubTotal" runat="server" CssClass="esdTextBox" Width="50px" 
                                    Text='<%# DataBinder.Eval(Container, "DataItem._subTotal") %>'></asp:TextBox>
                </ItemTemplate>
                <HeaderStyle Font-Size="X-Small" />
            </asp:TemplateField>
        </Columns>
        <HeaderStyle CssClass="esdGridHeaderStyle" />
        <PagerStyle CssClass="gridPagerStyle" />
        <RowStyle CssClass="esdGridRowStyle" />
        <SelectedRowStyle CssClass="esdGridSelectedRowStyle" />
        <EmptyDataTemplate>
            <div id="gridempty">
                <asp:Image ID="imgEmpty" runat="server" 
                                ImageUrl="../Images/Controls/Attention.png" />
                            &nbsp;No existen registros para esta solicitud.
                        </div>
        </EmptyDataTemplate>
    </asp:GridView>


    <br/>
                         <br />
                         <asp:GridView ID="GVDetalleProducto0" runat="server"  ScrollBars="Auto" 
                            ScrollWidth="100%" Width="100%" AutoGenerateColumns="False" 
                            ShowHeaderWhenEmpty="True"  > 
     
                            
                           
                         <AlternatingRowStyle CssClass="esdGridAlternativeRowStyle" />
            
                    <Columns>
                     <asp:TemplateField>
                            <ItemTemplate>
                                <asp:ImageButton ID="grdBttCmdEdit0" CommandName="CmdEdit" CommandArgument="<%# Container.DataItemIndex %>"
                                    runat="server" ImageUrl="../Images/Icons/Enabled/Edit.png" 
                                    ToolTip="Filtrar Producto" />
                            </ItemTemplate>
                            <HeaderStyle Width="22px" />
                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        </asp:TemplateField>

                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:ImageButton ID="grdBttCmdMost" CommandName="CmdMst" CommandArgument="<%# Container.DataItemIndex %>"
                                    runat="server" ImageUrl="../Images/Icons/Enabled/HISTAPRO.png" 
                                    ToolTip="Mostrar el Registro" />
                            </ItemTemplate>
                            <HeaderStyle Width="22px" />
                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        </asp:TemplateField>

                       <asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:CheckBox ID="chkBxSelect" runat="server" />
                                    </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="N°">
                            <ItemTemplate>
                                <asp:TextBox ID="txtNumCorrelativo"  CssClass="esdTextBox"  runat="server"  Text='<%# DataBinder.Eval(Container, "DataItem._Nu_Correla") %>'
                                 Width="50px"></asp:TextBox>
                            </ItemTemplate>
                            <FooterStyle Font-Size="X-Small" />
                            <HeaderStyle Font-Size="X-Small" />
                            <ItemStyle Font-Size="X-Small" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="idProducto" Visible="False">
                            <ItemTemplate>
                                <asp:TextBox ID="txtIdproducto0" runat="server"  CssClass="esdTextBox"  
                                    Width="100px"  Text='<%# DataBinder.Eval(Container, "DataItem._Codigo") %>' 
                                    Enabled="False"></asp:TextBox>
                            </ItemTemplate>
                            <FooterStyle Font-Size="X-Small" />
                            <HeaderStyle Font-Size="X-Small" />
                            <ItemStyle Font-Size="X-Small" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Id pres" Visible="False">
                            <ItemTemplate>
                                <asp:TextBox ID="txtIdPres0" runat="server" CssClass="esdTextBox"  Width="50px"  
                                    Text='<%# DataBinder.Eval(Container, "DataItem._Pres") %>' Enabled="False"></asp:TextBox>
                            </ItemTemplate>
                            <HeaderStyle Font-Size="X-Small" />
                            <FooterStyle Font-Size="X-Small" />
                           
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Producto">
                            <ItemTemplate>
                                <asp:TextBox ID="txtDsProducto0" runat="server" CssClass="esdTextBox"  
                                    Width="200px"  Text='<%# DataBinder.Eval(Container, "DataItem._Producto") %>' 
                                    Enabled="False"></asp:TextBox>
                            </ItemTemplate>
                            <HeaderStyle Font-Size="X-Small" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Presentacion">
                            <ItemTemplate>
                                <asp:TextBox ID="txtPresentacion0" runat="server" CssClass="esdTextBox"  
                                    Width="50px"  Text='<%# DataBinder.Eval(Container, "DataItem._Presenta") %>' 
                                    Enabled="False"></asp:TextBox>
                            </ItemTemplate>
                           <FooterStyle Font-Size="X-Small" />
                            <HeaderStyle Font-Size="X-Small" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="U.M">
                            <ItemTemplate>
                                <asp:TextBox ID="txtUM0" runat="server" CssClass="esdTextBox"  Width="50px"  
                                    Text='<%# DataBinder.Eval(Container, "DataItem._UM") %>' Enabled="False"></asp:TextBox>
                            </ItemTemplate>
                            <FooterStyle Font-Size="X-Small" />
                            <HeaderStyle Font-Size="X-Small" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Peso Bruto" Visible="False">

                            <ItemTemplate>
                                <asp:TextBox ID="txtPesoBruto0" runat="server" CssClass="esdTextBox"  
                                    Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._Peso_Bruto") %>' 
                                    Enabled="False"></asp:TextBox>
                            </ItemTemplate>
                            <FooterStyle Font-Size="X-Small" />
                            <HeaderStyle Font-Size="X-Small" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Lote">
                            <ItemTemplate>
                                <asp:TextBox ID="txtLote0" runat="server" CssClass="esdTextBox" Width="50px" 
                                    Text='<%# DataBinder.Eval(Container, "DataItem._Lote") %>'></asp:TextBox>
                            </ItemTemplate>
                            <HeaderStyle Font-Size="X-Small" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Fec. Vencimiento">
                            <ItemTemplate>
                                <asp:TextBox ID="txtFecVencimiento0" runat="server" CssClass="esdTextBox" 
                                    Width="75px" Text='<%# DataBinder.Eval(Container, "DataItem._fe_venc") %>'></asp:TextBox>
                            </ItemTemplate>
                            <HeaderStyle Font-Size="X-Small" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Fec.Entrega">
                            <ItemTemplate>
                                <asp:TextBox ID="txtFecEngrega0" runat="server" CssClass="esdTextBox" 
                                    Width="75px" 
                                    Text='<%# DataBinder.Eval(Container, "DataItem._fe_Entrega") %>'></asp:TextBox>
                            </ItemTemplate>
                            <HeaderStyle Font-Size="X-Small" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="O.P">
                            <ItemTemplate>
                                <asp:DropDownList ID="dpdOP" runat="server" Width="100px" >
                                    <asp:ListItem Value="P000002">Bocanegra</asp:ListItem>
                                    <asp:ListItem Value="P000003">Faucett</asp:ListItem>
                                </asp:DropDownList>
                            </ItemTemplate>
                            <HeaderStyle Font-Size="X-Small" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Cantidad">
                            <ItemTemplate>
                                <asp:TextBox ID="txtCantidad0" runat="server" CssClass="esdTextBox" 
                                    Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._Cant") %>'></asp:TextBox>
                            </ItemTemplate>
                            <HeaderStyle Font-Size="X-Small" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="p.Neto">
                            <ItemTemplate>
                                <asp:TextBox ID="txtPneto0" runat="server" CssClass="esdTextBox" Width="50px" 
                                    Text='<%# DataBinder.Eval(Container, "DataItem._PreNeto") %>'></asp:TextBox>
                            </ItemTemplate>
                            <FooterStyle Font-Size="X-Small" />
                            <HeaderStyle Font-Size="X-Small" />
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="P.U">
                            <ItemTemplate>
                                <asp:TextBox ID="txtPU0" runat="server" CssClass="esdTextBox" Width="50px" 
                                    Text='<%# DataBinder.Eval(Container, "DataItem._PreUnit") %>'></asp:TextBox>
                            </ItemTemplate>
                            <ControlStyle Font-Size="X-Small" />
                            <HeaderStyle Font-Size="X-Small" />
                        </asp:TemplateField>

                          <asp:TemplateField HeaderText="%Desc">
                             
                              <ItemTemplate>
                                  <asp:TextBox ID="txtPorDesc"  CssClass="esdTextBox"  runat="server" Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._nu_pordscto") %>'></asp:TextBox>
                              </ItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Afect.IGV">
                                    <ItemTemplate>
                                        <asp:CheckBox ID="chkBxIGV" runat="server"  />
                                    </ItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="T.G">
                            <ItemTemplate>
                                <asp:DropDownList ID="dpTG" runat="server" Width="150px">
                                </asp:DropDownList>
                            </ItemTemplate>
                            <ControlStyle Font-Size="X-Small" />
                            <FooterStyle Font-Size="X-Small" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Und.Negocio">
                            <ItemTemplate>
                                <asp:DropDownList ID="dpdUN" runat="server" Width="150px" AutoPostBack="True" 
                                   >
                                </asp:DropDownList>
                            </ItemTemplate>
                            <HeaderStyle Font-Size="X-Small" />
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="C.C">
                            <ItemTemplate>
                                <asp:DropDownList ID="dpdCC" runat="server" Width="150px"  AutoPostBack="True" 
                                      >
                                </asp:DropDownList>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="idCosto">
                            <ItemTemplate>
                                <asp:TextBox ID="txtIdccostos" CssClass="esdTextBox"  runat="server" Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._idCosto") %>' ></asp:TextBox>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="dsCosto" Visible="False">
                            <ItemTemplate>
                                <asp:TextBox ID="txtdsCosto" CssClass="esdTextBox"  runat="server" Width="150px" Text='<%# DataBinder.Eval(Container, "DataItem._C_Costos") %>'></asp:TextBox>
                            </ItemTemplate>
                        </asp:TemplateField>

                         <asp:TemplateField HeaderText="Gto.Import">
                            <ItemTemplate>
                                <asp:DropDownList ID="dpdGtoImport" runat="server" Width="150px">
                                </asp:DropDownList>
                            </ItemTemplate>
                        </asp:TemplateField>

                          <asp:TemplateField>
                            <ItemTemplate>
                                <asp:ImageButton ID="grdBttCmdCalcular" CommandName="CmdCalc" CommandArgument="<%# Container.DataItemIndex %>"
                                    runat="server" ImageUrl="../Images/Icons/Enabled/Calculator.png" 
                                    ToolTip="Actualizar Totales"/>
                            </ItemTemplate>
                            <HeaderStyle Width="22px" />
                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Dscto">
                            <ItemTemplate>
                                <asp:TextBox ID="txtDscto0" runat="server" CssClass="esdTextBox" Width="50px" 
                                    Text='<%# DataBinder.Eval(Container, "DataItem._Dscto") %>'></asp:TextBox>
                            </ItemTemplate>
                            <FooterStyle Font-Size="X-Small" />
                            <HeaderStyle Font-Size="X-Small" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="IGV">
                            <ItemTemplate>
                                <asp:TextBox ID="txtIGV0" runat="server" CssClass="esdTextBox" Width="50px"></asp:TextBox>
                            </ItemTemplate>
                            <HeaderStyle Font-Size="X-Small" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Sub. Total">
                            <ItemTemplate>
                                <asp:TextBox ID="txtSubTotal0" runat="server" CssClass="esdTextBox" 
                                    Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._subTotal") %>'></asp:TextBox>
                            </ItemTemplate>
                            <HeaderStyle Font-Size="X-Small" />
                        </asp:TemplateField>
                        
                       <asp:TemplateField>
                             <ItemStyle HorizontalAlign="Center" Width="40px" CssClass="etiqueta"></ItemStyle>
                             <ItemTemplate>
                             <asp:ImageButton ID="btnEliminar" runat="server" ImageUrl="~/Images/Icons/Enabled/bt_borrar.gif"
                                 CommandName="CmdDel" 
                                 CommandArgument='<%# Container.DataItemIndex%>'>
                              </asp:ImageButton>
                            </ItemTemplate>
                           </asp:TemplateField>

                    </Columns>
                     <HeaderStyle CssClass="esdGridHeaderStyle" />
                        <PagerStyle CssClass="gridPagerStyle" />
                        <RowStyle CssClass="esdGridRowStyle" />
                        <SelectedRowStyle CssClass="esdGridSelectedRowStyle" />
                       <EmptyDataTemplate>
                        <div id="gridempty0">
                            <asp:Image ID="imgEmpty" runat="server" ImageUrl="../Images/Controls/Attention.png" />
                            &nbsp;No existen registros para esta solicitud.
                        </div>
                    </EmptyDataTemplate>
                </asp:GridView>



    <asp:Label ID="lblDCPDMensaje" runat="server" Visible="false" CssClass="mensajeexito"
                                            Width="100%" ForeColor="#ff6600" BackColor="whitesmoke" EnableViewState="false">
                                        </asp:Label>
</asp:Content>
